package com.mqy.mybatis.pojo;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;

@ToString
@Getter
@Setter
public class TbUser {

  private Long id;
  private String username;
  private String password;
  private String email;
  private String gender;
  private Long flag;
  private Long role;
  private String code;

  private List<TbOrder> orderList;
//无参的构造方法必须保留
  public TbUser() {
  }
  //如果没有无参的构造,mybaits会调用有参数的,但是因为不知道什么列和什么参数有关系,所以就按照位置顺序, 将返回的数据的列一一对应到构造参数中
  //如果构造返回的顺序和返回的列的顺序不一致,可能会出现问题,要么类型报错,要么值报错
  public TbUser(Long flag,String username, String password,  String email, String gender, Long id, Long role, String code) {
    this.id = id;
    this.username = username;
    this.password = password;
    this.email = email;
    this.gender = gender;
    this.flag = flag;
    this.role = role;
    this.code = code;
  }

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public String getUsername() {
    return username;
  }

  public void setUsername(String username) {
    this.username = username;
  }

  public String getPassword() {
    return password;
  }

  public void setPassword(String password) {
    this.password = password;
  }

  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email;
  }

  public String getGender() {
    return gender;
  }

  public void setGender(String gender) {
    this.gender = gender;
  }

  public Long getFlag() {
    return flag;
  }

  public void setFlag(Long flag) {
    this.flag = flag;
  }

  public Long getRole() {
    return role;
  }

  public void setRole(Long role) {
    this.role = role;
  }

  public String getCode() {
    return code;
  }

  public void setCode(String code) {
    this.code = code;
  }


}
